/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.hl7.v3;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;

import org.eclipse.emf.common.util.Enumerator;

/**
 * <!-- begin-user-doc -->
 * A representation of the literals of the enumeration '<em><b>Realm Of Use</b></em>',
 * and utility methods for working with them.
 * <!-- end-user-doc -->
 * <!-- begin-model-doc -->
 * abstDomain: A11050 (C-0-T11046-A11050-cpt)
 * <!-- end-model-doc -->
 * @see org.hl7.v3.V3Package#getRealmOfUse()
 * @model extendedMetaData="name='RealmOfUse'"
 * @generated
 */
public enum RealmOfUse implements Enumerator {
	/**
	 * The '<em><b>Canada</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #CANADA_VALUE
	 * @generated
	 * @ordered
	 */
	CANADA(0, "Canada", "Canada"),

	/**
	 * The '<em><b>North America</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #NORTH_AMERICA_VALUE
	 * @generated
	 * @ordered
	 */
	NORTH_AMERICA(1, "NorthAmerica", "NorthAmerica"),

	/**
	 * The '<em><b>USA</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #USA_VALUE
	 * @generated
	 * @ordered
	 */
	USA(2, "USA", "USA"),

	/**
	 * The '<em><b>UV</b></em>' literal object.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @see #UV_VALUE
	 * @generated
	 * @ordered
	 */
	UV(3, "UV", "UV");

	/**
	 * The '<em><b>Canada</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>Canada</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #CANADA
	 * @model name="Canada"
	 * @generated
	 * @ordered
	 */
	public static final int CANADA_VALUE = 0;

	/**
	 * The '<em><b>North America</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>North America</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #NORTH_AMERICA
	 * @model name="NorthAmerica"
	 * @generated
	 * @ordered
	 */
	public static final int NORTH_AMERICA_VALUE = 1;

	/**
	 * The '<em><b>USA</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>USA</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #USA
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int USA_VALUE = 2;

	/**
	 * The '<em><b>UV</b></em>' literal value.
	 * <!-- begin-user-doc -->
	 * <p>
	 * If the meaning of '<em><b>UV</b></em>' literal object isn't clear,
	 * there really should be more of a description here...
	 * </p>
	 * <!-- end-user-doc -->
	 * @see #UV
	 * @model
	 * @generated
	 * @ordered
	 */
	public static final int UV_VALUE = 3;

	/**
	 * An array of all the '<em><b>Realm Of Use</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private static final RealmOfUse[] VALUES_ARRAY =
		new RealmOfUse[] {
			CANADA,
			NORTH_AMERICA,
			USA,
			UV,
		};

	/**
	 * A public read-only list of all the '<em><b>Realm Of Use</b></em>' enumerators.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static final List<RealmOfUse> VALUES = Collections.unmodifiableList(Arrays.asList(VALUES_ARRAY));

	/**
	 * Returns the '<em><b>Realm Of Use</b></em>' literal with the specified literal value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static RealmOfUse get(String literal) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			RealmOfUse result = VALUES_ARRAY[i];
			if (result.toString().equals(literal)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Realm Of Use</b></em>' literal with the specified name.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static RealmOfUse getByName(String name) {
		for (int i = 0; i < VALUES_ARRAY.length; ++i) {
			RealmOfUse result = VALUES_ARRAY[i];
			if (result.getName().equals(name)) {
				return result;
			}
		}
		return null;
	}

	/**
	 * Returns the '<em><b>Realm Of Use</b></em>' literal with the specified integer value.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static RealmOfUse get(int value) {
		switch (value) {
			case CANADA_VALUE: return CANADA;
			case NORTH_AMERICA_VALUE: return NORTH_AMERICA;
			case USA_VALUE: return USA;
			case UV_VALUE: return UV;
		}
		return null;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final int value;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String name;

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private final String literal;

	/**
	 * Only this class can construct instances.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	private RealmOfUse(int value, String name, String literal) {
		this.value = value;
		this.name = name;
		this.literal = literal;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public int getValue() {
	  return value;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getName() {
	  return name;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public String getLiteral() {
	  return literal;
	}

	/**
	 * Returns the literal value of the enumerator, which is its string representation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public String toString() {
		return literal;
	}
	
} //RealmOfUse
